
    /**  
    * @Title: LogServiceFactory.java
    * @Package com.efast.cafe.commponent.log.service
    * @Description: TODO(用一句话描述该文件做什么)
    * @author Administrator
    * @date 2018年8月31日
    * @version V1.0  
    */
    
package com.efast.cafe.commponent.log.service;

import com.efast.cafe.commponent.log.constant.LogConstant;
import com.efast.cafe.framework.spring.SpringContextUtils;
import com.efast.cafe.util.ConfigUtil;

/**
    * @ClassName: LogServiceFactory
    * @Description: TODO(这里用一句话描述这个类的作用)
    * @author Administrator
    * @date 2018年8月31日
    *
    */

public class LogServiceFactory {

	private static String STORAGE=ConfigUtil.getValue(LogConstant.K_STORAGE);
	
	public static LogStorageService getService(){
		LogStorageService service = null;
		switch(STORAGE){
			case "none":
				service = SpringContextUtils.getBean("logStorageNoneService", LogStorageService.class);
				break;
			case "mongodb":
				service = SpringContextUtils.getBean("logStorageMongoService", LogStorageService.class);
				break;
			case "mysql":
				service = SpringContextUtils.getBean("logStorageMysqlService", LogStorageService.class);
				break;
			case "oracle":
				service = SpringContextUtils.getBean("logStorageOracleService", LogStorageService.class);
				break;
			default:
				service = SpringContextUtils.getBean("logStorageNoneService", LogStorageService.class);
				break;
		}
		return service;
	}
}
